// we need to bootstrap main applications here. Page need to provide a context. such as module name here.
require(['jquery', 'require'], function($,require) {

    // loading common module
    require(['bootstrap.min']);
	require(['app/module/jquery-extension']);

	var moduleName = $('#module-name').html();
	require([
            'module/common/essential',
            'module/chat/chat',
            'module/form/signupForm',
            'module/form/loginForm',
            'module/form/passwordChangeForm',
            'module/people/profile',
            'module/form/profileChange',
            'module/form/profile-pic',
            'module/form/signupSuccess'
        ],
        function(essential,chat,signupForm, loginForm, passwordChangeForm,profile,profileChange,profilePic,signupSuccess){
            essential();
            chat.initialize();
            new signupForm();
            new loginForm();
            new passwordChangeForm();
            new profile();
            new profileChange();
            new profilePic();
            new signupSuccess();
        });

    require(['module/home', 'module/home/search'], function(mainUpdate, search){
        if(mainUpdate.initialize){
            mainUpdate.initialize();
        } else {
            new mainUpdate();
        }
        new search($('.main-content'), $('.js-search-people'));
    });

    require(['module/common/pop'], function(pop){
        $('.js_invite').once('click', function(){
            pop('invite-form');
        });
    });

});
